package com.example.policymode6;

/**
 * @author zhang
 */
public class Order {
    private String uid;
    private String name;
    private double price;
    public Order(String uid, String name, double price) {
        this.uid = uid;
        this.name = name;
        this.price = price;
    }
    public String pay() {
        return pay(PayStrategy.DEFAULT_PAY);
    }
    public String pay(String payKey) {
        Payment payment = PayStrategy.get(payKey);
        System.out.println("购买："+name+" ,使用" + payment.getName() + "支付, " + "支付金额为: " + price);
        return payment.pay(uid, price);
    }
}